package com.equipment.user.web.web.filter;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.context.request.WebRequest;

import java.text.SimpleDateFormat;

/**
 * 输入过滤
 *
 * @author Administrator
 */
public class WebBindingInitializer implements org.springframework.web.bind.support.WebBindingInitializer {

    @Override
    public void initBinder(WebDataBinder binder, WebRequest request) {
        binder.registerCustomEditor(String.class, new InputFilterEditor(true, true, true));
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
        dateFormat.setLenient(true);
    }

}